崩溃问题

chengzhenyu %!s(int64=8) %!d(string=hace) años
padre
commit
3f79e3abcd

+ 3 - 3
app/src/main/java/ai/pai/lensman/main/SyncTimeInteractor.java

@@ -67,6 +67,9 @@ public class SyncTimeInteractor implements BaseInteractor {
67 67
                     if (isCancelled) {
68 68
                         return false;
69 69
                     }
70
+                    if(BuildConfig.isTestMode){
71
+                        return true;
72
+                    }
70 73
                     String setTimeResp = HttpUtils.doHttpPost(BoxUrlContainer.SET_TIME_URL, boxParams);
71 74
                     LogHelper.d("czy", "时间同步任务 box设置时间应答=" + setTimeResp);
72 75
                     if (isCancelled) {
@@ -81,9 +84,6 @@ public class SyncTimeInteractor implements BaseInteractor {
81 84
                     if (isCancelled) {
82 85
                         return false;
83 86
                     }
84
-                    if(BuildConfig.isTestMode){
85
-                        return true;
86
-                    }
87 87
                     JSONObject boxJson = new JSONObject(boxResp);
88 88
                     int boxStatus = boxJson.getInt("status");
89 89
                     if (boxStatus == 200) {

+ 0 - 23
app/src/main/java/ai/pai/lensman/session/SessionPresenter.java

@@ -1,13 +1,8 @@
1 1
 package ai.pai.lensman.session;
2 2
 
3
-import android.content.BroadcastReceiver;
4
-import android.content.Context;
5 3
 import android.content.Intent;
6
-import android.content.IntentFilter;
7
-import android.net.ConnectivityManager;
8 4
 
9 5
 import com.android.common.utils.LogHelper;
10
-import com.android.common.utils.NetworkUtil;
11 6
 
12 7
 import java.util.ArrayList;
13 8
 import java.util.Timer;
@@ -37,17 +32,6 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
37 32
 
38 33
     private static final String TAG = "SessionPresenter";
39 34
 
40
-    private BroadcastReceiver wifiReceiver  = new BroadcastReceiver() {
41
-        @Override
42
-        public void onReceive(Context context, Intent intent) {
43
-            if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) {
44
-                if(NetworkUtil.isWifiConnected(context)){
45
-                    App.getAppContext().startService(new Intent(App.getAppContext(), UploadService.class));
46
-                }
47
-            }
48
-        }
49
-    };
50
-
51 35
     public SessionPresenter(SessionBean sessionBean, SessionContract.View view) {
52 36
         this.sessionView = view;
53 37
         this.sessionBean = sessionBean;
@@ -79,12 +63,10 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
79 63
             }
80 64
         },1000,1000);
81 65
         Preferences.getInstance().setCurrentSession(sessionBean.sessionId);
82
-        registerWifiChangeReceiver();
83 66
     }
84 67
 
85 68
     @Override
86 69
     public void stop() {
87
-        App.getAppContext().unregisterReceiver(wifiReceiver);
88 70
         boxStatusInteractor.cancelJob();
89 71
         interactor.endSession();
90 72
         refreshTimer.cancel();
@@ -169,9 +151,4 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
169 151
         }
170 152
     }
171 153
 
172
-    private void registerWifiChangeReceiver() {
173
-        IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
174
-        App.getAppContext().registerReceiver(wifiReceiver,filter);
175
-    }
176
-
177 154
 }